package com.zxt.recruit.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * 
 * @TableName sys_element_user_roles_ref
 */
@TableName(value ="sys_element_user_roles_ref")
@Data
public class SysElementUserRolesRef implements Serializable {
    /**
     * 用户角色关系id
     */
    @TableId(type = IdType.AUTO)
    private Long userRolesRefId;

    /**
     * 用户id
     */
    private String userFk;

    /**
     * 角色id
     */
    private Long rolesFk;

    /**
     * 插入时间
     */
    private LocalDateTime inputTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SysElementUserRolesRef other = (SysElementUserRolesRef) that;
        return (this.getUserRolesRefId() == null ? other.getUserRolesRefId() == null : this.getUserRolesRefId().equals(other.getUserRolesRefId()))
            && (this.getUserFk() == null ? other.getUserFk() == null : this.getUserFk().equals(other.getUserFk()))
            && (this.getRolesFk() == null ? other.getRolesFk() == null : this.getRolesFk().equals(other.getRolesFk()))
            && (this.getInputTime() == null ? other.getInputTime() == null : this.getInputTime().equals(other.getInputTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUserRolesRefId() == null) ? 0 : getUserRolesRefId().hashCode());
        result = prime * result + ((getUserFk() == null) ? 0 : getUserFk().hashCode());
        result = prime * result + ((getRolesFk() == null) ? 0 : getRolesFk().hashCode());
        result = prime * result + ((getInputTime() == null) ? 0 : getInputTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", userRolesRefId=").append(userRolesRefId);
        sb.append(", userFk=").append(userFk);
        sb.append(", rolesFk=").append(rolesFk);
        sb.append(", inputTime=").append(inputTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}